<?php

namespace Chaosyeo\SolarEngine\Event;

class LoginProperties extends Properties
{
    protected $loginType;    // 登录类型
    protected $status;       // 登录状态

    /**
     * @param string $loginType 登录类型（必传）
     * @param string $status 登录状态（可选）
     */
    public function __construct(int $platform, string $loginType, array $params = [], array $customProperties = [])
    {
        if (empty($loginType)) {
            throw new \InvalidArgumentException('Login type is required');
        }
        
        if (strlen($loginType) > 32) {
            throw new \InvalidArgumentException('Login type cannot exceed 32 characters');
        }

        $this->loginType = $loginType;

        parent::__construct($platform, $params, $customProperties);
    }
}